load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")

# TODO: Move this library out of the nervous_system directory.
# In the meantime, allow everyone to use this.
package(default_visibility = ["//visibility:public"])

DEPENDENCIES = [
    "@crate_index//:ic-metrics-encoder",
]

DEV_DEPENDENCIES = [
    "@crate_index//:pretty_assertions",
    "@crate_index//:prometheus-parse",
]

LIB_SRCS = glob(
    ["src/**/*.rs"],
    exclude = ["**/*tests*/**"],
)

rust_library(
    name = "histogram",
    srcs = LIB_SRCS,
    crate_name = "ic_nervous_system_histogram",
    version = "0.0.1",
    deps = DEPENDENCIES,
)

rust_test(
    name = "histogram_test",
    srcs = glob(["src/**/*.rs"]),
    deps = DEPENDENCIES + DEV_DEPENDENCIES,
)
